﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using QuanLiThuVien.Source;

namespace QuanLiThuVien
{
    /// <summary>
    /// Interaction logic for TacGia.xaml
    /// </summary>
    
    public partial class TacGia : Window
    {
        private THUVIEN.Service1 serv = new THUVIEN.Service1();
        private InsertInfo m_insertInfo = new InsertInfo();
        public TacGia()
        {
            InitializeComponent();
        }

        private bool KiemTraNhap()
        {
            if (txtDiaChiTG.Text == "" || txtTacGia.Text == "")
                return true;
            else return false;
        }

        private void bntOkTG_Click(object sender, RoutedEventArgs e)
        {
            if (KiemTraNhap())
                MessageBox.Show("Phải nhập đầy đủ thông tin", "Thông báo");
            else
                m_insertInfo.InsertTacGia(txtTacGia.Text, txtDiaChiTG.Text);
        }

        private void bntThoatTG_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
